package io.github.stary1993.kite.auth.support;

import io.github.stary1993.kite.security.core.OauthClientDetails;
import io.github.stary1993.kite.security.support.OauthClientDetailsService;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 *  默认的OauthClientDetailsService
 * @author stary1993
 */
@Component
public class DefaultOauthClientDetailsService implements OauthClientDetailsService {

    @Override
    public List<OauthClientDetails> list() {
        List<OauthClientDetails> list = new ArrayList<>();
        OauthClientDetails clientDetails = new OauthClientDetails();
        clientDetails.setClientId("kite");
        clientDetails.setClientSecret("kite");
        clientDetails.setScope("server");
        clientDetails.setAuthorizedGrantTypes(new String[]{"password", "refresh_token"});
        list.add(clientDetails);
        return list;
    }
}
